package com.xuecheng.media.service;

import com.xuecheng.model.RestResponse;
import com.xuecheng.media.model.dto.UploadFileParamsDto;

import java.io.IOException;

public interface BigFilesService {

    /**
     * 文件上传前检查文件
     *
     * @param fileMd5
     * @return
     */
    RestResponse<Boolean> checkFile(String fileMd5);

    /**
     * 检查分块文件
     * @param fileMd5
     * @param chunk
     * @return
     */
    RestResponse<Boolean> checkChunk(String fileMd5, int chunk);

    /**
     * 上传分块文件
     * @param absolutePath
     * @param fileMd5
     * @param chunk
     */
    RestResponse uplodChunk(String absolutePath, String fileMd5, int chunk) throws IOException;

    /**
     * 合并文件
     * @param companyId
     * @param fileMd5
     * @param chunkTotal
     * @param uploadFileParamsDto
     * @return
     */
    RestResponse mergeChunks(Long companyId,String fileMd5,int chunkTotal, UploadFileParamsDto uploadFileParamsDto );

}
